
<script src="web/assets/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
<div class="clearfix"></div>
<div class="content">  

    <!-- Modal -->
    <div class="modal fade" id="myModalSucursalADD" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <br>
                    <i class="icon-credit-card icon-7x"></i>
                    <h4 id="myModalLabel" class="semi-bold">Sucursal</h4>
                    <p class="no-margin"> </p>
                    <br>
                </div>

                <div class="modal-body">
                    <form  action="./fuentes/controller/Sucursal.php" id="formSucursal" name="formSucursal" autocomplete="off" > 
                        <?php require_once '/FormSucursal.php'; ?>
                    </form>    
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
    </div>

    <div class="row" id="movimiento">
        <div class="col-md-12">
            <div class="grid simple ">
                <div class="grid-title no-border">
                    <h4><span class="semi-bold">Listado de Sucursales</span></h4>
                    <button style="float: right;" class="btn btn-success btn-xs " id="agregar" data-toggle="modal"  data-target="#myModalSucursalADD"> Agregar</button>
                    <div class="labelRight" id="error">	

                    </div>
                </div>
                <div class="grid-body no-border">

                    <table class="table table-hover no-more-tables table-condensed  " id="sucursalTABLE">
                        <thead>
                            <tr>
                                <th style="width:1%" >
                                    ID
                                </th>
                                <th style="width:40%">Nombre </th>

                                <th style="width:5%">Accion</th>
                            </tr>
                        </thead>
                        <tbody id="sucursalList">

                            <?php
                            if ($sucursales) {
                                foreach ($sucursales as $dato) {
                                    echo "<tr >";

                                    echo "<td>";
                                    echo $dato["id"];
                                    echo "</td>";

                                    echo "<td>";
                                    echo $dato["nombre"];
                                    echo "</td>";
                                    
                                    echo "<td>";
                                    echo "<button class='btn btn-success btn-xs btn-mini' onclick='editDatos(" . $dato["id"] . ")' title='Editar' ><i class='fa fa-pencil'></i></button>";
                                    echo "&nbsp;&nbsp; ";
                                    echo "<button class='btn btn-success btn-xs btn-mini' onclick='eliminarDato(" . $dato["id"] . ")'  title='Eliminar' ><i class='fa fa-times'></i></button>";

                                    echo "</td>";
                                    echo " </tr>";
                                }
                            } else {
                                echo "                      
                               <tr class='status-pending'>
                                <td></td>
                                <td>NO EXISTEN REGISTROS</td>
                                <td></td>
                               
                              </tr>";
                            }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!-- END PAGE --> 
</div>

<script src="./fuentes/view/sucursal/js/script_ajax_sucursal.js" type="text/javascript"></script>


